package com.sdstc.modules.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sdstc.modules.eneity.OrgDistributeParamVo;
import com.sdstc.modules.eneity.OrgEntity;
import com.sdstc.modules.vo.InstitutionDetailVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author ：wk
 * @date ：Created in 2022/10/21 13:52
 */
public interface OrgDao extends BaseMapper<OrgEntity> {
    @Select("select count(if(post_big_cate_code = 'organ_admin',true,null)) as orgAdminNow,count(if(post_big_cate_code = 'organ_cause',true,null)) as orgCauseNow,count(if(post_big_cate_code = 'organ_single',true,null)) as orgSingleNow,count(if(post_big_cate_code = 'organ_work',true,null)) as orgWorkNow from person where org_id = #{id} and (status = #{ok} or status = #{high})")
    InstitutionDetailVo queryPostCateCount(@Param("id") String id, @Param("ok") String ok, @Param("high") String high);

    List<OrgEntity> queryOrgByOrgNameLike(@Param("pid") String pid, @Param("orgName")String orgName);

    void orgDistributeById(OrgDistributeParamVo vo);
}
